<template>
  <div class="thumb">
    <div class="item-box">
      <a :href="data.href" class="img-box">
        <ImgLazy :url="require('@/assets/images/home/'+data.imgsrc)" />
      </a>
      <PlayButton :duration="1000" v-if="isPlay"></PlayButton>
      <i class="album-cover" v-if="isDetaile"></i>
      <span class="update-time" v-if="isDetaile">{{data.updateTime}}</span>
    </div>
    <div class="item-info">
      <p class="album-name">
        <a :href="data.href">{{data.text}}</a>
      </p>
      <p class="singer">
        <a :href="data.href">{{data.singer}}</a>
      </p>
    </div>
  </div>
</template>

<script>
export default {
    name:"AlbumItem",
    props: {
        data:Object,
        isDetaile:{
            type:Boolean,
            default:true
        },
        isPlay:{
            type:Boolean,
            default:false
        }
    }
}
</script>

<style lang="scss" scoped>
.thumb {
  margin: 0 21px;
  .item-box {
    position: relative;
    &::after {
      content: "";
      display: block;
      width: 100%;
      padding-bottom: 100%;
    }
    .album-cover {
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
      left: 25px;
      background-position: 0 0;
      background-repeat: no-repeat;
      background-size: contain;
      background-image: url("../../assets/images/home/album-cover.png");
      z-index: 0;
    }
    .update-time {
      display: block;
      width: 85px;
      height: 24px;
      line-height: 24px;
      color: #fff;
      border-radius: 12px;
      text-align: center;
      background: rgba(0, 0, 0, 0.4);
      position: absolute;
      bottom: 6px;
      right: 6px;
      font-size: 12px;
      z-index: 1;
    }
  }
  .item-info {
    p {
      height: 19px;
      line-height: 19px;
    }
    a {
      color: inherit;
      &:hover {
        color: $ThemeColor;
      }
    }
    .album-name {
      margin-top: 16px;
    }
    .singer {
      margin-top: 12px;
      color: #999;
    }
  }
}
</style>